#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int maxn;
	int minn;
	int cnt = 0;
	for(int i = 0;i<n;i++)
	{
		int x;
		cin>>x;
		if(i==0) 
		{
			maxn = x;
			minn = x; 
		}
		else 
		{
			if(x>maxn)
			{
				cnt++;
				maxn = x;
			}
			if(x<minn)
			{
				cnt++;
				minn = x;
			}
		}
	}
	cout<<cnt<<endl;
}
